#include <iostream>

using namespace std;

// 82.53 %
class Solution
{
  public:
	bool isPalindrome(int x)
	{
		if (x < 0)
			return false;
		int temp = x, res = 0;
		while (temp)
		{
			res = res * 10 + temp % 10;
			temp /= 10;
		}
		return x == res;
	}
};

int main()
{
	int x = 1221;
	cout << Solution().isPalindrome(x) << endl;
	return 0;
}
